package com.gtw.modules.api.service.impl;

import com.gtw.modules.api.service.TbAnnouncementService;
import com.gtw.modules.dao.TbAnnouncementDao;
import com.gtw.modules.entity.TbAnnouncement;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;


@Service("announcementservice")
public class TbAnnouncementServiceImpl implements TbAnnouncementService {
    @Autowired
    private TbAnnouncementDao tbAnnouncementDao;

    @Override
    public TbAnnouncement queryObject(Integer id) {
        return tbAnnouncementDao.selectByPrimaryKey(id);
    }

    @Override
    public List<TbAnnouncement> queryList(Map<String, Object> map) {
        return tbAnnouncementDao.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return tbAnnouncementDao.queryTotal(map);
    }

    @Override
    @Transactional(rollbackFor=Exception.class)
    public void save(TbAnnouncement announcement) {
        tbAnnouncementDao.save(announcement);
    }

    @Override
    @Transactional(rollbackFor=Exception.class)
    public void update(TbAnnouncement announcement) {
        tbAnnouncementDao.update(announcement);
    }

    @Override
    @Transactional(rollbackFor=Exception.class)
    public void delete(Integer id) {
        tbAnnouncementDao.delete(id);
    }

    @Override
    @Transactional(rollbackFor=Exception.class)
    public void deleteBatch(Integer[] ids) {
        tbAnnouncementDao.deleteBatch(ids);
    }

    @Override
    public List<TbAnnouncement> findALL() {
        return tbAnnouncementDao.findALL();
    }

}
